//
//  PhotoCollectionViewCell.m
//  XiangMuB
//
//  Created by lanou3g on 16/8/18.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "PhotoCollectionViewCell.h"

@implementation PhotoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupSubviews];
    }
    return self;
    
}


- (void)setupSubviews{
    
    self.imagesVie = [[UIImageView alloc] init];
    [self.contentView addSubview:self.imagesVie];
    
    self.selectButton = [[UIButton alloc] init];
    self.selectButton.backgroundColor = [UIColor clearColor];
    [self.selectButton setImage:[UIImage imageNamed:@"btn_unselected"] forState:UIControlStateNormal];
    [self.selectButton setImage:[UIImage imageNamed:@"btn_selected"] forState:UIControlStateSelected];
    self.selectButton.contentMode = UIViewContentModeScaleToFill;
    [self.contentView addSubview:self.selectButton];
}

- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    CGFloat height = 25;
    
    self.imagesVie.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    
    self.selectButton.frame = CGRectMake(self.contentView.frame.size.width - height - 5, 5, height, height);
    
}

@end
